<@master template="/common/master"  title="首页-p2p金融">
    <@include file="/common/head"/>
  	<@head title="充值"/>
    <form id="subForm" role="form" class="form-horizontal action-ajax-form" action="/member/submit/pay">
	    <div class="czBlockBox">
	    	<input id="currentBalance" type="hidden" value="${wallet.currentBalance}"/>
	   		<div class="momeyList">可用余额：<span class="red"><@numberFormat value="${wallet.currentBalance}" /></span>元</div>
	        <div class="mt20">
	        	充值金额：<input name="amount" type="number" class="p2pInp"  placeholder="建议充值100以上面额">
	        </div>
	   </div>
	    <div class="czBlockBox mt20">
	        <div class="mt20 bankList">
	            <i class="yhkIco1"></i>
	        	银行卡
	            <span class="bankMub">***${bankNo}</span>
	        </div>
	   </div>
	   <div class="btnBox">
		    <p id="errorText" class="wrong tac">${errorMsg}</p>
	    	<a id="subBtn" href="#" class="tzBtn">立即充值</a>
	   </div>
   </form>
   <div id="loadingDiv" class="bodyBg" style="display:none;">
    	<div class="gifTxt"><@img src="/images/p2p/gif1.gif"/></div>
    </div>
    <div id="confirmDiv" class="bodyBg" style="display:none;">
	    <div class=" tsTxt">
			<a href="#" class="close"></a>
			<div class="tcTxt b_b"><strong>充值确认</strong></div>
		    <p class="tac c999 lh60 mt20">确定充值<span class="red">0</span>元吗?</p>
		    <div class="mt10 pt20">
		    	<a id="confirmBtn" href="#" class="btn60_blue">确定</a><a id="cancelBtn" href="#" class="btn60_glay ml20">取消</a>
		    </div>
	 	</div>
 	</div>
</@master>
<@js>
    $(document).ready(function(){
    	$('#cancelBtn').bind("click",function(){
    		$('#confirmDiv').hide();
    	});
    	$('.close').bind("click",function(){
    		$('#confirmDiv').hide();
    	});
    	$('#confirmBtn').bind("click",function(){
    		$('#confirmDiv').hide();
    		$('#loadingDiv').show();
			$('#subForm').submit();
    	});
    	$('#subBtn').bind("click",function(){
    		var rege=/^\d+(\.\d+)?$/;
    		var amount=$('#subForm input[name="amount"]').val();
    		if(!rege.test(amount)){
    			$('#errorText').text('金额格式不对');
    			return false;
    		}
    		$('#errorText').text('');
    		$('#confirmDiv .red').text(amount);
    		$('#confirmDiv').show();
    	});
	});
</@js>
<@jsRender/>